package com.flying.abs;

/**
 * @author 刘鹏飞
 * @Classname WorkDog
 * @Date 2024/12/13 1:17
 * @Created by 刘鹏飞
 * @Description 工作犬抽象类
 */
public abstract class WorkDog {

    private String name;
    private int age;


    public WorkDog() {
    }

    public WorkDog(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "WorkDog{" +
               "name='" + name + '\'' +
               ", age=" + age +
               '}';
    }

    /**
     * 抽象方法
     */
    public abstract void work();

    public void eat(String food) {
        System.out.println(this.name + "正在吃" + food);
    }


}
